class Solution {
public:
    int lengthOfLongestSubstring(string s) {
        int count=0;
        int n=s.size();
        for(int left=0;left<n;++left)
        {
            char hash[200]={};
            int num=0;
            for(int right=left;right<n;++right)
            {
                if(hash[s[right]]>0)
                    break;
                else
                {
                    hash[s[right]]++;
                    num++;
                    count=max(num,count);
                }
            }
        }
        return count;
    }
};
